package com.tqz.jvm;

/**
 * <p>动态加载测试类。
 *
 * @author tianqingzhao
 * @since 2022/3/27 16:55
 */
public class DynamicLoadTest {
    
    static {
        System.out.println("DynamicLoadTest static code block");
    }
    
    public static void main(String[] args) {
        new A();
        DynamicLoadTest dynamicLoadTest = new DynamicLoadTest();
        B b = new B();
    }
}

class A {
    
    static {
        System.out.println("A static code block");
    }
    
    public A() {
        System.out.println("A construct method");
    }
}

class B {
    
    static {
        System.out.println("B static code block");
    }
    
    public B() {
        System.out.println("B construct method");
    }
}